#include <iostream>
using namespace std;

#include "Singleton.h"
using namespace Pattern;

class MySingleton
{
public:
	void ShowMsg()
	{
		std::cout<<"MySingleton::ShowMsg()"<<endl;
	}
private:
	MySingleton(void) { cout<<"MySingleton::MySingleton()"<<endl; }
	~MySingleton(void) { cout<<"MySingleton::~MySingleton()"<<endl; }

	DECLARE_SINGLETON_CLASS(MySingleton);
	//friend class auto_ptr <MySingleton>;
	//friend class Singleton <MySingleton>;
};

typedef Singleton<MySingleton> MySingletonTest;

int main(int argc, char *argv[]) 
{
	std::cout<<"main() start"<<endl;
	MySingletonTest::GetInstance().ShowMsg();
	MySingletonTest::GetInstancePtr()->ShowMsg();
	std::cout<<"main() end"<<endl;

	system("pause");
	return EXIT_SUCCESS;
}